package icu.study.netty.client;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * @program: protobuf
 * @description:
 * @author: 1246263205@qq.com
 * @create: 2020-11-19 09:40
 */
public class Client {
    public static void main(String[] args) throws Exception {
        EventLoopGroup eventExecutors = new NioEventLoopGroup();
        Bootstrap bootstrap = new Bootstrap();
        bootstrap.group(eventExecutors).channel(NioSocketChannel.class).handler(new ClientInitializer());
        ChannelFuture future = bootstrap.connect("127.0.0.1", 8899).sync();
        future.channel().closeFuture().sync();
    }
}